package com.fg.cloud.factory.controller.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fg.cloud.common.StatusCode;
import com.fg.cloud.common.quantity.ResultType;
import com.fg.cloud.framework.controller.BaseController;
import com.fg.cloud.manager.service.system.IndustryService;


/**
 * Description:系统行业Controller
 * @author around
 * @date 2017年8月8日上午11:44:49
 */
@Controller
@RequestMapping("/industry")
public class IndustryController extends BaseController {

	@Autowired
	private IndustryService industryService;
	
	/**
	 * Description:查询系统行业 by Select
	 * @param request
	 * @param response
	 * @param filter
	 * @author around
	 * @date 2017年8月8日上午11:46:51
	 */
	@RequestMapping(value="/select", method = {RequestMethod.POST, RequestMethod.GET})
	@ResponseBody
	public void select(HttpServletRequest request, HttpServletResponse response, 
			String filter) {
		try {
			doResult(response, true, StatusCode.FINDSUCCESS, 
					industryService.findBySelect(), ResultType.FIND_SUCCESS);
		} catch (Exception e) {
			doResult(response, false, StatusCode.FINDERROR, null, ResultType.FIND_FAULT);
			e.printStackTrace();
		}
	}
	
}
